var con = require("../../../utils/data.js");
var app = getApp();
Page({
  data: {
    list: [],
    articleTwo: []
  },
  onLoad: function () {
    var that = this;
    wx.request({
      url: con.hospital_getslide,
      method: 'GET',
      data: { wxappid: con.wyy_user_wxappid },
      header: {
        "Content-Type": "application/json"
      },
      success: function (res) {
        // console.log(res.data.info);
        that.setData({
          list: res.data.info
        })
      }
    });

    var oneRequest = { "data": { "status": "1", "info": [{ "id": "17", "wxappid": "6", "info": "装修啦", "img": "http://www.weiyunyi.com/Uploads/20170714/596875c0e3698.png", "url": "测试地址" }, { "id": "18", "wxappid": "6", "info": "专修", "img": "http://www.weiyunyi.com/Uploads/20170714/596875903b58f.png", "url": "测试地址" }, { "id": "19", "wxappid": "6", "info": "地方", "img": "http://www.weiyunyi.com/Uploads/20170714/596875a17b67c.png", "url": "测试地址" }, { "id": "20", "wxappid": "6", "info": "1231", "img": "http://www.weiyunyi.com/Uploads/20170714/596875b286885.png", "url": "测试地址" }] }, "header": { "Server": "NWSs", "Date": "Fri, 29 Dec 2017 05:09:37 GMT", "Content-Type": "application/json; charset=utf-8", "Content-Length": "635", "Connection": "keep-alive", "Cache-Control": "must-revalidate, no-store", "Pragma": "no-cache", "X-Powered-By": "PHP/5.4.33,ASP.NET", "Set-Cookie": "PHPSESSID=mf9bqq904gotakvbc89hvou536; path=/", "X-NWS-LOG-UUID": "90d58785-5cf5-46ff-99eb-27cebed9c416", "X-Daa-Tunnel": "hop_count=2" }, "statusCode": 200, "errMsg": "request:ok" };


  that.setData({
    list: oneRequest.data.info
  });



    // wx.request({
    //   url: con.hospital_gettype,
    //   method: 'GET',
    //   data: { wxappid: con.wyy_user_wxappid },
    //   header: {
    //     "Content-Type": "application/json"
    //   },
    //   success: function (res) {
    //     // console.log(res.data.info);
    //     that.setData({
    //       type: res.data.info
    //     })
    //   } 
    // });
  var twoRequest = { "data": { "status": "1", "info": [{ "id": "5", "wxappid": "6", "name": "装修报价", "img": "http://www.weiyunyi.com/Uploads/20170714/5968785d116e1.png", "sorts": "0", "isshow": "1", "image": "http://www.weiyunyi.com/Uploads/20170714/59687aef0f7e0.jpg", "type": null }, { "id": "6", "wxappid": "6", "name": "装修攻略", "img": "http://www.weiyunyi.com/Uploads/20170714/59687afa70dfb.png", "sorts": "0", "isshow": "1", "image": "http://www.weiyunyi.com/Uploads/20170715/5969ccc2650ec.png", "type": null }, { "id": "7", "wxappid": "6", "name": "装修公司", "img": "http://www.weiyunyi.com/Uploads/20170714/59687b1e6b403.png", "sorts": "0", "isshow": "1", "image": "http://www.weiyunyi.com/Uploads/20170714/59687b278edc6.jpg", "type": null }, { "id": "8", "wxappid": "6", "name": "团购活动", "img": "http://www.weiyunyi.com/Uploads/20170714/59687b38ee272.png", "sorts": "0", "isshow": "1", "image": "http://www.weiyunyi.com/Uploads/20170714/59687b48942d5.jpg", "type": null }] }, "header": { "Server": "NWSs", "Date": "Fri, 29 Dec 2017 05:09:37 GMT", "Content-Type": "application/json; charset=utf-8", "Content-Length": "993", "Connection": "keep-alive", "Cache-Control": "must-revalidate, no-store", "Pragma": "no-cache", "X-Powered-By": "PHP/5.4.33,ASP.NET", "Set-Cookie": "PHPSESSID=mmvlk6gmjl59v0vmfkmmdpoj20; path=/", "X-NWS-LOG-UUID": "6966c573-2b82-46a2-88cc-ac76befc6cb3", "X-Daa-Tunnel": "hop_count=2" }, "statusCode": 200, "errMsg": "request:ok" };

    that.setData({
      type: twoRequest.data.info
    })




  },
  bindType: function (e) {
    var len = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: 'newsItem/newsItem?id=' + len,
    })
  }
})